package com.jeebey.mybatis.dialect.impl;

import com.jeebey.mybatis.dialect.IDialect;

/**
 * @since 1.0
 * @author <a href="mailto:84961426@qq.com">JuST4iT</a>
 * @version $Id: MysqlDialect.java Feb 18, 2016 6:04:48 PM $
 */

public class MysqlDialect implements IDialect {

	public String createPagingSql(String sql, int offset, int size) {
		String _sql_format = "%s LIMIT %d,%d";
		return String.format(_sql_format, sql, offset, size);
	}

	public String createIdentitySql() {
		return "SELECT LAST_INSERT_ID()";
	}
	
	@Override
	public String createClearCacheSql() {
		return "SELECT 1";
	}
}
